package com.lou.springboot.dao;

import com.lou.springboot.entity.Blog;
import com.lou.springboot.utils.PageUtil;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * Created by Guaguaerhao on 2020/7/9 22:34
 */
@Mapper
public interface BlogDao {
    int getTotalBlog(PageUtil pageUtil);
    int getTotalBlogsByTagId(PageUtil pageUtil);
    boolean deleteByPrimaryKey(Long blogId);
    Long insertBlog(Blog blog);
    int deleteBatch(Long[] ids);
    int updateBlog(Blog blog);
    int increaseBlogViews(Long blogId);
    Blog selectByPrimaryKey(Long blogId);
    Blog selectByBlogName(@Param("blogTitle") String blogTitle);
    List<Blog> findBlogList(Map map);
    List<Blog> findBlogListByTagId(PageUtil pageUtil);
    List<Blog> getBlogListByType(int type, int limit);
}
